package com.bsy.videostation.model

/**
 * Created by Sincerity on 2024/5/31.
 * Copyright
 * 描述：
 */
data class VideoEntity(
    var id: String? = "",
    var cover: String? = "",
    var isVertical: Boolean? = false,
    var title: String? = "",
    var detail: String? = "",
    var isShowTitle: Boolean? = false,
    var sourceIcon: String? = "",
    var sourceName: String? = "",
    var time: Long? = 0L,
    var index: Int = 0
) {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as VideoEntity

        if (id != other.id) return false
        if (cover != other.cover) return false
        if (isVertical != other.isVertical) return false
        if (title != other.title) return false
        if (detail != other.detail) return false
        if (isShowTitle != other.isShowTitle) return false
        if (sourceIcon != other.sourceIcon) return false
        if (sourceName != other.sourceName) return false
        if (time != other.time) return false
        if (index != other.index) return false

        return true
    }

    override fun hashCode(): Int {
        var result = id?.hashCode() ?: 0
        result = 31 * result + (cover?.hashCode() ?: 0)
        result = 31 * result + (isVertical?.hashCode() ?: 0)
        result = 31 * result + (title?.hashCode() ?: 0)
        result = 31 * result + (detail?.hashCode() ?: 0)
        result = 31 * result + (isShowTitle?.hashCode() ?: 0)
        result = 31 * result + (sourceIcon?.hashCode() ?: 0)
        result = 31 * result + (sourceName?.hashCode() ?: 0)
        result = 31 * result + (time?.hashCode() ?: 0)
        result = 31 * result + index
        return result
    }
}